home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume10 / pccurses14 / part04 < prev    next >
Encoding:
Text File  |  1990-01-19  |  49.9 KB  |  1,628 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v10i018: PCcurses v.1.4 part 4 of 7
  3. from: bl@infovox.se (Bj|rn Larsson)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 10, Issue 18
  7. Submitted-by: bl@infovox.se (Bj|rn Larsson)
  8. Archive-name: pccurses14/part04
  9.  
  10. # ----------------------------- cut here -----------------------------
  11. #! /bin/sh
  12. # This is a shell archive. Remove anything before the `cut' line,
  13. # then unpack by saving it into a file and typing `sh file'. The
  14. # archive ends by exit(0), so don't worry about trailing junk.
  15. #       (This is archive 4 in a series of 7).
  16. # Contents:
  17. #   charget.c
  18. #   cursesio.asm
  19. #   makefile.68
  20. #   prntscan.c
  21. #   update.c
  22. # Wrapped by USER@MS-DOS --- Sun Jan 14 14:02:40 1990
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f charget.c -a "${1}" != "-c" ; then 
  25.   echo Will not over-write existing file \"charget.c\"
  26. else
  27. echo Extracting - \"charget.c\"
  28. sed "s/^X//" >charget.c <<'END_OF_charget.c'
  29. X/****************************************************************/
  30. X/* Getch() routines of the PCcurses package            */
  31. X/*                                */
  32. X/****************************************************************/
  33. X/* This version of curses is based on ncurses, a curses version    */
  34. X/* originally written by Pavel Curtis at Cornell University.    */
  35. X/* I have made substantial changes to make it run on IBM PC's,    */
  36. X/* and therefore consider myself free to make it public domain.    */
  37. X/*                Bjorn Larsson (bl@infovox.se)    */
  38. X/****************************************************************/
  39. X/* 1.4:  Routines that ended in while-loops now end        */
  40. X/*     with return(ERR) to avoid compiler warnings.        */
  41. X/*     Use of short wherever possible. Portability        */
  42. X/*     improvements:                    900114    */
  43. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  44. X/* 1.2:     #undef:ine of getch now covers all the file, to    */
  45. X/*     make sure this module's getch() calls go to DOS,    */
  46. X/*     not to the PCCurses 'getch()' function. Fixed        */
  47. X/*     thanks to N.D. Pentcheff:            881002    */
  48. X/* 1.1:     Bug fixes: call to _curseskeytest() changed        */
  49. X/*     _curseskeytst(). Test of that routine also        */
  50. X/*     lacked () in one place:            870907    */
  51. X/* 1.0:     Release:                    870515    */
  52. X/****************************************************************/
  53. X
  54. X#include <curses.h>
  55. X#include <curspriv.h>
  56. X
  57. X#undef getch                /* We use MSC getch() below */
  58. X#undef ungetch
  59. X
  60. X#include <conio.h>
  61. X
  62. Xstatic    short    rawgetch();        /* get raw char via BIOS */
  63. Xstatic    short    sysgetch();        /* get char via system */
  64. Xstatic    short    validchar();        /* keypad xlate and char check */
  65. X
  66. Xchar _curses_charget_rcsid[] = "@(#)charget.c    v.1.4  - 900114";
  67. X
  68. Xstatic    short    buffer[_INBUFSIZ];    /* character buffer */
  69. Xstatic    short    pindex = 0;        /* putter index */
  70. Xstatic    short    gindex = 1;        /* getter index */
  71. Xstatic    WINDOW *w;            /* to reduce stack usage */
  72. Xstatic    short    ungind = 0;        /* wungetch() push index */
  73. Xstatic    short    ungch[NUNGETCH];    /* array of ungotten chars */
  74. X
  75. X/* Table for key code translation of function keys in keypad mode */
  76. X/* These values are for strict IBM keyboard compatibles only */
  77. X
  78. Xstatic    short    kptab[] =
  79. X  {
  80. X  0x3b,KEY_F(1),  0x3c,KEY_F(2),  0x3d,KEY_F(3),  0x3e,KEY_F(4),
  81. X  0x3f,KEY_F(5),  0x40,KEY_F(6),  0x41,KEY_F(7),  0x42,KEY_F(8),
  82. X  0x43,KEY_F(9),  0x44,KEY_F(10), 0x47,KEY_HOME,  0x48,KEY_UP,
  83. X  0x49,KEY_PPAGE, 0x4b,KEY_LEFT,  0x4d,KEY_RIGHT, 0x4f,KEY_LL,
  84. X  0x50,KEY_DOWN,  0x51,KEY_NPAGE, 0x52,KEY_IC,    0x53,KEY_DC,
  85. X  0x54,KEY_F(11), 0x55,KEY_F(12), 0x56,KEY_F(13), 0x57,KEY_F(14),
  86. X  0x58,KEY_F(15), 0x59,KEY_F(16), 0x5a,KEY_F(17), 0x5b,KEY_F(18),
  87. X  0x5c,KEY_F(19), 0x5d,KEY_F(20), 0x5e,KEY_F(21), 0x5f,KEY_F(22),
  88. X  0x60,KEY_F(23), 0x61,KEY_F(24), 0x62,KEY_F(25), 0x63,KEY_F(26),
  89. X  0x64,KEY_F(27), 0x65,KEY_F(28), 0x66,KEY_F(29), 0x67,KEY_F(30),
  90. X  0x73,KEY_LEFT,  0x74,KEY_RIGHT,  0x75,KEY_LL,   0x76,KEY_NPAGE,
  91. X  0x77,KEY_HOME,  0x84,KEY_PPAGE,  0x100,        -1
  92. X  };
  93. X
  94. X/****************************************************************/
  95. X/* Wgetch(win) gets a character from the terminal, in normal,    */
  96. X/* cbreak or raw mode, optionally echoing to window  'win'.    */
  97. X/****************************************************************/
  98. X
  99. Xint wgetch(win)
  100. X  WINDOW    *win;
  101. X  {
  102. X  short    key;
  103. X  short    cbr;
  104. X
  105. X  if (ungind)                    /* if ungotten char exists */
  106. X    return(ungch[--ungind]);            /* remove and return it */
  107. X
  108. X  if ((!_cursvar.raw) && (!_cursvar.cbreak))    /* if normal */
  109. X    if (gindex < pindex)            /* and data in buffer */
  110. X      return(buffer[gindex++]);
  111. X
  112. X  w = win;                    /* static for speed & stack */
  113. X  pindex = 0;                    /* prepare to buffer data */
  114. X  gindex = 0;
  115. X  while(1)                    /* loop for any buffering */
  116. X    {
  117. X    if (_cursvar.raw)                /* get a raw character */
  118. X      key = rawgetch();
  119. X    else                    /* get a system character */
  120. X      {
  121. X      cbr = _cursesgcb();            /* get ^BREAK status */
  122. X      _cursesscb(_cursvar.orgcbr);        /* if break return proper */
  123. X      key = sysgetch();
  124. X      _cursesscb(cbr);                /* restore as it was */
  125. X      }
  126. X    if (w->_nodelay && (key == -1))        /* if nodelay and no char */
  127. X      return(-1);
  128. X    if ((key == '\r') && _cursvar.autocr && !_cursvar.raw) /* translate cr */
  129. X      key = '\n';
  130. X    if (_cursvar.echo && (key < 0x100))        /* check if echo */
  131. X      {
  132. X      waddch(w,key);
  133. X      wrefresh(w);
  134. X      }
  135. X    if (_cursvar.raw || _cursvar.cbreak)    /* if no buffering */
  136. X      return(key);
  137. X    if (pindex < _INBUFSIZ-2)            /* if no overflow, */
  138. X      buffer[pindex++] = key;            /* put data in buffer */
  139. X    if ((key == '\n') || (key == '\r'))        /* if we got a line */
  140. X      return(buffer[gindex++]);
  141. X    } /* while */
  142. X  return (ERR);                    /* Can't happen */
  143. X  } /* wgetch */
  144. X
  145. X/****************************************************************/
  146. X/* Flushinp() kills any pending input characters.        */
  147. X/****************************************************************/
  148. X
  149. Xvoid flushinp()
  150. X  {
  151. X  while(_curseskeytst())        /* empty keyboard buffer */
  152. X    _curseskey();
  153. X  while(kbhit())            /* empty system's buffers */
  154. X    (void) getch();
  155. X  gindex = 1;                /* set indices to kill buffer */
  156. X  pindex = 0;
  157. X  ungind = 0;                /* clear ungch array */
  158. X  } /* flushinp */
  159. X
  160. X/****************************************************************/
  161. X/* Wungetch() pushes back it's argument on the input stream. If    */
  162. X/* OK, returns 1, otherwise returns 0.                */
  163. X/****************************************************************/
  164. X
  165. Xint    wungetch(ch)
  166. X  int     ch;
  167. X  {
  168. X  if (ungind >= NUNGETCH)        /* pushback stack full */
  169. X    return(0);
  170. X  ungch[ungind++] = ch;
  171. X  return(1);
  172. X  } /* wungetch() */
  173. X
  174. X/****************************************************************/
  175. X/* Mvgetch() first moves the stdscr cursor to a new location,    */
  176. X/* then does a wgetch() on stdscr.                */
  177. X/****************************************************************/
  178. X
  179. Xint    mvgetch(y,x)
  180. X  int y;
  181. X  int x;
  182. X  {
  183. X  wmove(stdscr,y,x);
  184. X  return(wgetch(stdscr));
  185. X  } /* mvgetch */
  186. X
  187. X/****************************************************************/
  188. X/* Mvwgetch() first moves the cursor of window 'win' to a new    */
  189. X/* location, then does a wgetch() in 'win'.            */
  190. X/****************************************************************/
  191. X
  192. Xint mvwgetch(win,y,x)
  193. X  WINDOW *win;
  194. X  int y;
  195. X  int x;
  196. X  {
  197. X  wmove(win,y,x);
  198. X  return(wgetch(win));
  199. X  } /* mvwgetch */
  200. X
  201. X/****************************************************************/
  202. X/* rawgetch() gets a character without any interpretation at    */
  203. X/* all and returns it. If keypad mode is active for the desig-    */
  204. X/* nated window, function key translation will be performed.    */
  205. X/* Otherwise, function keys are ignored.If nodelay mode is    */
  206. X/* active in the window, then rawgetch() returns -1 if no cha-    */
  207. X/* racter is available.                        */
  208. X/****************************************************************/
  209. X
  210. Xstatic short rawgetch()
  211. X  {
  212. X  short    c;
  213. X
  214. X  if (w->_nodelay && !_curseskeytst())
  215. X    return(-1);
  216. X  while(1)                      /* loop to get valid char */
  217. X    {
  218. X    if ((c = validchar(_curseskey())) >= 0)
  219. X      return(c);
  220. X    } /* while */
  221. X  return (ERR);                    /* Can't happen */
  222. X  } /* rawgetch */
  223. X
  224. X/****************************************************************/
  225. X/* Sysgetch() gets a character with normal ^S, ^Q, ^P and ^C    */
  226. X/* interpretation and returns it. If keypad mode is active for    */
  227. X/* the designated window, function key translation will be per-    */
  228. X/* formed. Otherwise, function keys are ignored. If nodelay    */
  229. X/* mode is active in the window, then sysgetch() returns -1 if    */
  230. X/* no character is available.                    */
  231. X/****************************************************************/
  232. X
  233. Xstatic short sysgetch()
  234. X  {
  235. X  short    c;
  236. X
  237. X  if (w->_nodelay && !kbhit())
  238. X    return(-1);
  239. X  while(1)
  240. X    {
  241. X    c = getch();
  242. X    if (c)                    /* if not a function key */
  243. X      return(c & 0xff);                /* avoids sign-extending */
  244. X    c = getch();
  245. X    if ((c = validchar(c << 8)) >= 0)        /* get & check next char */
  246. X      return(c);
  247. X    } /* while */
  248. X  return (ERR);                    /* Can't happen */
  249. X  } /* sysgetch */
  250. X
  251. X/****************************************************************/
  252. X/* Validchar(c) chacks that 'c' is a valid character, and    */
  253. X/* if so returns it, with function key translation applied if    */
  254. X/* 'w' has keypad mode set. If char is invalid, returns -1.    */
  255. X/****************************************************************/
  256. X
  257. Xstatic short validchar(c)
  258. X  int    c;
  259. X  {
  260. X  short *scanp;
  261. X
  262. X  if (c == 0x0300)            /* special case, ^@ = NULL */
  263. X    return(0);
  264. X  if (!(c & 0xff00))            /* normal character */
  265. X    return(c);
  266. X  if (!(w->_keypad))            /* skip f keys if not keypad mode */
  267. X    return(-1);
  268. X  c = (c >> 8) & 0xff;
  269. X  scanp = kptab;
  270. X  while(*scanp <= c)            /* search for value */
  271. X    {                    /* (stops on table entry 0x100) */
  272. X    if (*scanp++ == c)
  273. X      return(*scanp);            /* found, return it */
  274. X    scanp++;
  275. X    }
  276. X  return(-1);                /* not found, invalid */
  277. X  } /* validchar */
  278. X
  279. X/****************************************************************/
  280. X/* _cursespendch() returns 1 if there is any character avai-    */
  281. X/* lable, and 0 if there is none. This is not for programmer    */
  282. X/* usage, but for the updatew routines.                */
  283. X/****************************************************************/
  284. X
  285. Xbool    _cursespendch()
  286. X  {
  287. X  if (ungind)                /* ungotten char */
  288. X    return(TRUE);
  289. X  if (pindex > gindex)            /* buffered char */
  290. X    return(TRUE);
  291. X  if (_cursvar.raw)            /* raw mode test */
  292. X    return(_curseskeytst());
  293. X  return((bool)kbhit());        /* normal mode test */
  294. X  } /* _cursespendch */
  295. END_OF_charget.c
  296. if test 9326 -ne `wc -c <charget.c`; then
  297.     echo \"charget.c\" unpacked with wrong size!
  298. fi
  299. # end of overwriting check
  300. fi
  301. if test -f cursesio.asm -a "${1}" != "-c" ; then 
  302.   echo Will not over-write existing file \"cursesio.asm\"
  303. else
  304. echo Extracting - \"cursesio.asm\"
  305. sed "s/^X//" >cursesio.asm <<'END_OF_cursesio.asm'
  306. X    TITLE   PCcurses BIOS Control Functions for MicroSoft Assembler
  307. X    NAME    CURSESIO
  308. X    PAGE    46,132
  309. X    ;****************************************************************
  310. X    ;*             CURSESIO.ASM                *
  311. X    ;*                                *
  312. X    ;* This file contains 'C' functions for the MicroSoft 'C' com-    *
  313. X    ;* piler v.4.0, and for Borland Turbo 'C'. It exercises a num-    *
  314. X    ;* ber of BIOS video calls, and is intended for inclusion in    *
  315. X    ;* a curses library package.                    *
  316. X    ;*                                *
  317. X    ;* The two files FARNEAR.INC and SMALHUGE.INC each contain one    *
  318. X    ;* EQUate. These define the module's memory model.        *
  319. X    ;*                                *
  320. X    ;****************************************************************
  321. X    ;* This version of curses is based on ncurses, a curses version    * 
  322. X    ;* originally written by Pavel Curtis at Cornell University.    *
  323. X    ;* I have made substantial changes to make it run on IBM PC's,    *
  324. X    ;* and therefore consider myself free to make it public domain.    *
  325. X    ;*                Bjorn Larsson (bl@infovox.se)    *
  326. X    ;****************************************************************
  327. X    ;* Author: Bjorn Larsson                    *
  328. X    ;* Revised:                            *
  329. X    ;* 1.4:  For other module changes:            901114    *
  330. X    ;* 1.3:  Changes in 'C' modules for checking with        *
  331. X    ;*     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    *
  332. X    ;* 1.2:     Changed call sequence to some routines, thanks        *
  333. X    ;*     to S. Creps. Changed segment name in far code        *
  334. X    ;*     mode, thanks to N.D. Pentcheff:        881002    *
  335. X    ;* 1.1:  Bad error in curseskeytst(): JZ -> JNZ!    870911    *
  336. X    ;* 1.0:     Release:                    870515    *
  337. X    ;****************************************************************
  338. X    ;
  339. X    INCLUDE    FARNEAR.INC        ;DEFINE FAR OR NEAR CALL SEQUENCE
  340. X    INCLUDE    SMALHUGE.INC        ;DEFINE FAR OR NEAR DATA ACCESS
  341. X    ;
  342. XSYSTEM    EQU    21H            ;SYSTEM CALL
  343. XBRKCHK    EQU    33H            ;BREAK SET/CHECK FUNCTION CODE
  344. X    ;
  345. X    if far_call            ;OTHER TEXT NAME IF FAR CALLS
  346. XCURSESIO_TEXT    SEGMENT    BYTE PUBLIC 'CODE'
  347. X    ASSUME    CS: CURSESIO_TEXT
  348. X    else
  349. X_TEXT    SEGMENT  BYTE PUBLIC 'CODE'
  350. X    ASSUME  CS: _TEXT
  351. X    endif
  352. X    ;
  353. X    ;****************************************************************
  354. X    ;* Function entry and exit macros, and parameter fetch macro.    *
  355. X    ;* Used by all functions.                    *
  356. X    ;****************************************************************
  357. X    ;
  358. Xc_entry    MACRO    f_name
  359. X    ;
  360. X    if far_call
  361. X&f_name    proc far
  362. X    else
  363. X&f_name    proc near
  364. X    endif
  365. X    push    bp
  366. X    mov    bp,sp
  367. X    push    di
  368. X    push    si
  369. X    ;
  370. X    ENDM
  371. X    ;
  372. Xc_exit    MACRO    f_name
  373. X    ;
  374. X    pop    si
  375. X    pop    di
  376. X    pop    bp
  377. X    ret
  378. X&f_name    endp
  379. X    ;
  380. X    ENDM
  381. X    ;
  382. Xg_parm    MACRO    reg,p_num
  383. X    if    far_call
  384. X    mov    ®,[bp+&p_num*2+4]
  385. X    else
  386. X    mov    ®,[bp+&p_num*2+2]
  387. X    endif
  388. X    ;
  389. X    ENDM
  390. X    ;
  391. X    DB    '@(#)cursesio.asm v.1.4  - 900114', 0
  392. X    ;
  393. X    PAGE
  394. X    ;****************************************************************
  395. X    ;*            _cursescattr                *
  396. X    ;*                                *
  397. X    ;* void _cursescattr(chr,attr)                    *
  398. X    ;*                                *
  399. X    ;* Writes char 'chr' with attributes 'attr' to the current cur-    *
  400. X    ;* sor location.                        *
  401. X    ;****************************************************************
  402. X    PUBLIC    __cursescattr
  403. X    ;
  404. X    c_entry __cursescattr
  405. X    MOV    AH,9
  406. X    MOV    BH,0        ;USE PAGE 0
  407. X    g_parm    AL,1        ;GET CHR PARAMETER
  408. X    g_parm    BL,2        ;GET ATTR PARAMETER
  409. X    MOV    CX,1        ;PUT 1 CHARACTER
  410. X    INT    10H
  411. X    c_exit    __cursescattr
  412. X    ;
  413. X    ;****************************************************************
  414. X    ;*            _cursescursor                *
  415. X    ;*                                *
  416. X    ;* void _cursescursor(row,column)                *
  417. X    ;*                                *
  418. X    ;* Sets the cursor position in video page 0. 'row' and 'column'    *
  419. X    ;* are the cursor address. If 'row' is set to 25, no cursor at    *
  420. X    ;* all is displayed.                        *
  421. X    ;****************************************************************
  422. X    PUBLIC    __cursescursor
  423. X    ;
  424. X    c_entry __cursescursor
  425. X    MOV    AH,2
  426. X    MOV    BH,0        ;USE PAGE 0
  427. X    g_parm    DH,1        ;GET ROW PARAMETER
  428. X    g_parm    DL,2        ;GET COLUMN PARAMETER
  429. X    INT    10H
  430. X    c_exit    __cursescursor
  431. X     ;
  432. X    ;****************************************************************
  433. X    ;*            _cursesgcols                *
  434. X    ;*                                *
  435. X    ;* int _cursesgcols()                        *
  436. X    ;*                                *
  437. X    ;* Return the current number of columns on the screen.        *
  438. X    ;****************************************************************
  439. X    PUBLIC    __cursesgcols
  440. X    ;
  441. X    c_entry    __cursesgcols
  442. X    MOV    AH,15
  443. X    INT    10H
  444. X    MOV    AL,AH
  445. X    XOR    AH,AH
  446. X    c_exit    __cursesgcols
  447. X    ;
  448. X    ;****************************************************************
  449. X    ;*            _cursesputc                *
  450. X    ;*                                *
  451. X    ;* void _cursesputc(chr,colour)                    *
  452. X    ;*                                *
  453. X    ;* Output character 'chr' to screen in tty fashion. If a colour    *
  454. X    ;* mode is active, the character is written with colour        *
  455. X    ;* 'colour'.                            *
  456. X    ;****************************************************************
  457. X    PUBLIC    __cursesputc
  458. X    ;
  459. X    c_entry    __cursesputc
  460. X    MOV    AH,14
  461. X    g_parm    AL,1        ;GET CHR PARAMETER
  462. X    g_parm    BL,2        ;GET COLOUR PARAMETER
  463. X    INT    10H
  464. X    c_exit    __cursesputc
  465. X    ;
  466. X    ;****************************************************************
  467. X    ;*            _cursesscroll                *
  468. X    ;*                                *
  469. X    ;* void _cursesscroll(urow,lcol,lrow,rcol,lines,attr)        *
  470. X    ;*                                *
  471. X    ;* Scroll a window in the current page up or down. Urow, lcol,    *
  472. X    ;* lrow,rcol are the window coordinats. lines is the number of    *
  473. X    ;* lines to scroll. If 0, clears the window, if < 0 scrolls    *
  474. X    ;* down, > 0 scrolls up. Blanks areas that are left, and sets    *
  475. X    ;* character attributes to attr. If in a colour graphics mode,    *
  476. X    ;* fills them with the colour 'attr' instead.            *
  477. X    ;****************************************************************
  478. X    PUBLIC    __cursesscroll
  479. X    ;
  480. X    c_entry    __cursesscroll
  481. X    g_parm    AL,5        ;GET LINES PARAMETER
  482. X    MOV    AH,6
  483. X    TEST    AL,80H
  484. X    JZ    SHORT CS_1
  485. X    ;
  486. X    MOV    AH,7
  487. X    NEG    AL
  488. X    ;
  489. XCS_1:    g_parm    CH,1        ;GET UROW PARAMETER
  490. X    g_parm    CL,2        ;GET LCOL PARAMETER
  491. X    g_parm    DH,3        ;GET LROW PARAMETER
  492. X    g_parm    DL,4        ;GET RCOL PARAMETER
  493. X    g_parm    BH,6        ;GET ATTR PARAMETER
  494. X    INT    10H
  495. X    c_exit    __cursesscroll
  496. X    ;
  497. X    ;****************************************************************
  498. X    ;*            _cursesgcmode                *
  499. X    ;*                                *
  500. X    ;* int _cursesgcmode()                        *
  501. X    ;*                                *
  502. X    ;* Return the current cursor type. Bits 8-15 of the return    *
  503. X    ;* value is the start scan row, and bits 0-7 is the end scan    *
  504. X    ;* row.                                *
  505. X    ;****************************************************************
  506. X    PUBLIC    __cursesgcmode
  507. X    ;
  508. X    c_entry    __cursesgcmode
  509. X    MOV    AH,3
  510. X    INT    10H
  511. X    MOV    AX,CX
  512. X    c_exit    __cursesgcmode
  513. X    ;
  514. X    ;****************************************************************
  515. X    ;*            _cursescmode                *
  516. X    ;*                                *
  517. X    ;* void _cursescmode(startrow,endrow)                *
  518. X    ;*                                *
  519. X    ;* Sets the cursor type to begin in scan line startrow and end    *
  520. X    ;* in scan line endrow. Both values should be 0-31.        *
  521. X    ;****************************************************************
  522. X    PUBLIC    __cursescmode
  523. X    ;
  524. X    c_entry __cursescmode
  525. X    MOV    AH,1
  526. X    g_parm    CH,1        ;GET STARTROW PARAMETER
  527. X    g_parm    CL,2        ;GET ENDROW PARAMETER
  528. X    INT    10H
  529. X    c_exit    __cursescmode
  530. X    ;
  531. X    ;****************************************************************
  532. X    ;*             _curseskey                *
  533. X    ;*                                *
  534. X    ;* int _curseskey()                        *
  535. X    ;*                                *
  536. X    ;* Returns the next key code struck at the keyboard. If the low    *
  537. X    ;* 8 bits are 0, the upper bits contain the extended character    *
  538. X    ;* code. If bit 0-7 are non-zero, the upper bits = 0.        *
  539. X    ;****************************************************************
  540. X    PUBLIC    __curseskey
  541. X    ;
  542. X    c_entry __curseskey
  543. X    MOV    AH,0
  544. X    INT    16H
  545. X    CMP    AL,0
  546. X    JZ    SHORT EXTKEY
  547. X    AND    AX,0FFH
  548. XEXTKEY:
  549. X    c_exit    __curseskey
  550. X    ;
  551. X    ;****************************************************************
  552. X    ;*            _curseskeytst                *
  553. X    ;*                                *
  554. X    ;* int _curseskeytst()                        *
  555. X    ;*                                *
  556. X    ;* Returns 1 if a character is available, 0 otherwise.        *
  557. X    ;****************************************************************
  558. X    PUBLIC    __curseskeytst
  559. X    ;
  560. X    c_entry __curseskeytst
  561. X    MOV    AH,1
  562. X    INT    16H
  563. X    JNZ    SHORT TST1
  564. X    MOV    AX,0
  565. X    JMP    SHORT EXTTST
  566. XTST1:    MOV    AX,1
  567. XEXTTST:
  568. X    c_exit    __curseskeytst
  569. X    ;
  570. X    ;****************************************************************
  571. X    ;*            _cursesgcb                *
  572. X    ;*                                *
  573. X    ;* int _cursesgcb()                        *
  574. X    ;*                                *
  575. X    ;* Returns 1 if MSDOS BREAK CHECK is on, otherwise 0.        *
  576. X    ;****************************************************************
  577. X    PUBLIC    __cursesgcb
  578. X    ;
  579. X    c_entry __cursesgcb
  580. X    MOV    AX,BRKCHK*256+0
  581. X    INT    SYSTEM
  582. X    XOR    AH,AH
  583. X    MOV    AL,DL
  584. X    c_exit    __cursesgcb
  585. X    ;
  586. X    ;****************************************************************
  587. X    ;*            _cursesscb                *
  588. X    ;*                                *
  589. X    ;* void _cursesscb(setting)                    *
  590. X    ;*                                *
  591. X    ;* Sets MSDOS BREAK CHECK according to 'setting'.        *
  592. X    ;****************************************************************
  593. X    PUBLIC    __cursesscb
  594. X    ;
  595. X    c_entry __cursesscb
  596. X    MOV    AX,BRKCHK*256+1
  597. X    g_parm    DL,1
  598. X    AND    DL,DL
  599. X    JZ    SHORT SCB1
  600. X    MOV    DL,1
  601. XSCB1:    INT    SYSTEM
  602. X    c_exit    __cursesscb
  603. X    ;
  604. X    if far_call
  605. XCURSESIO_TEXT    ENDS
  606. X    else
  607. X_TEXT    ENDS
  608. X    endif
  609. X    if1
  610. X    %OUT    Pass 1 Completed
  611. X    else
  612. X    %OUT    Assembly Completed
  613. X    endif
  614. X    END
  615. END_OF_cursesio.asm
  616. if test 8421 -ne `wc -c <cursesio.asm`; then
  617.     echo \"cursesio.asm\" unpacked with wrong size!
  618. fi
  619. # end of overwriting check
  620. fi
  621. if test -f makefile.68 -a "${1}" != "-c" ; then 
  622.   echo Will not over-write existing file \"makefile.68\"
  623. else
  624. echo Extracting - \"makefile.68\"
  625. sed "s/^X//" >makefile.68 <<'END_OF_makefile.68'
  626. X#################################################################
  627. X#               PCCURSES                #
  628. X#                                #
  629. X# Makefile for the 68K version of the PCCURSES runtime        #
  630. X# library (CURSES.LIB) for the Paragon 'C' compiler and        #
  631. X# assembler.                            #
  632. X#################################################################
  633. X# 1.4:    Release:                    900114    #
  634. X#################################################################
  635. X
  636. XINCDIR=\mcc68k
  637. XLIBDIR=\m68k\lib
  638. XWRKDIR=wrk
  639. XCC=mcc68k
  640. XCFLAGS= /opt=all /DEFINE=BUG68K=1
  641. XASM=asm68k
  642. XAFLAGS= /E
  643. XLINK=lod68k
  644. XLFLAGS= /T /X
  645. XLIB=lib68k
  646. X
  647. X
  648. XHEADERS=    $(INCDIR)        $(INCDIR)\curses.h    \
  649. X        $(INCDIR)\curspriv.h    $(INCDIR)\stdio.h    \
  650. X        $(INCDIR)\conio.h
  651. X
  652. XOBJS=        $(WRKDIR)                    \
  653. X        $(WRKDIR)\attrib.obj    $(WRKDIR)\beep.obj    \
  654. X        $(WRKDIR)\border.obj    $(WRKDIR)\boxes.obj    \
  655. X        $(WRKDIR)\charadd.obj    $(WRKDIR)\chardel.obj    \
  656. X        $(WRKDIR)\charget.obj    $(WRKDIR)\charins.obj    \
  657. X        $(WRKDIR)\charpick.obj    $(WRKDIR)\clrtobot.obj    \
  658. X        $(WRKDIR)\clrtoeol.obj    $(WRKDIR)\endwin.obj    \
  659. X        $(WRKDIR)\initscr.obj    $(WRKDIR)\linedel.obj    \
  660. X        $(WRKDIR)\lineins.obj    $(WRKDIR)\longname.obj    \
  661. X        $(WRKDIR)\move.obj    $(WRKDIR)\mvcursor.obj    \
  662. X        $(WRKDIR)\newwin.obj    $(WRKDIR)\options.obj    \
  663. X        $(WRKDIR)\overlay.obj    $(WRKDIR)\prntscan.obj    \
  664. X        $(WRKDIR)\refresh.obj    $(WRKDIR)\scrreg.obj    \
  665. X        $(WRKDIR)\setmode.obj    $(WRKDIR)\setterm.obj    \
  666. X        $(WRKDIR)\stradd.obj    $(WRKDIR)\strget.obj    \
  667. X        $(WRKDIR)\tabsize.obj    $(WRKDIR)\termmisc.obj    \
  668. X        $(WRKDIR)\unctrl.obj    $(WRKDIR)\update.obj    \
  669. X        $(WRKDIR)\winclear.obj    $(WRKDIR)\windel.obj    \
  670. X        $(WRKDIR)\winerase.obj    $(WRKDIR)\winmove.obj    \
  671. X        $(WRKDIR)\winscrol.obj    $(WRKDIR)\wintouch.obj    \
  672. X        $(WRKDIR)\curses68.obj
  673. X
  674. X#################################################################
  675. X# Default targets.                        #
  676. X#################################################################
  677. X
  678. Xdefault:    $(HEADERS)    $(LIBDIR)\curses.lib
  679. X
  680. X#################################################################
  681. X# Directory creation and include file installation        #
  682. X#################################################################
  683. X
  684. X$(LIBDIR):
  685. X    mkdir $(LIBDIR)
  686. X
  687. X$(WRKDIR):
  688. X    mkdir $(WRKDIR)
  689. X
  690. X$(INCDIR):
  691. X    mkdir $(INCDIR)
  692. X
  693. X$(INCDIR)\curses.h: curses.h
  694. X    attrib -r $(INCDIR)\curses.h
  695. X    copy curses.h $(INCDIR)\curses.h
  696. X    attrib +r $(INCDIR)\curses.h
  697. X
  698. X$(INCDIR)\curspriv.h: curspriv.h
  699. X    attrib -r $(INCDIR)\curspriv.h
  700. X    copy curspriv.h $(INCDIR)
  701. X    attrib +r $(INCDIR)\curspriv.h
  702. X
  703. X$(INCDIR)\stdio.h: ..\rts68\stdio.h
  704. X    attrib -r $(INCDIR)\stdio.h
  705. X    copy ..\rts68\stdio.h $(INCDIR)
  706. X    attrib +r $(INCDIR)\stdio.h
  707. X
  708. X$(INCDIR)\conio.h: ..\rts68\conio.h
  709. X    attrib -r $(INCDIR)\conio.h
  710. X    copy ..\rts68\conio.h $(INCDIR)
  711. X    attrib +r $(INCDIR)\conio.h
  712. X
  713. X#################################################################
  714. X# Resultant linkable files generation:                #
  715. X#################################################################
  716. X
  717. X$(LIBDIR)\curses.lib:    $(LIBDIR) $(OBJS)
  718. X    cd $(WRKDIR)
  719. X    command -c $(LIB) <..\curses68.cmd
  720. X    copy curses.lib $(LIBDIR)
  721. X    cd ..
  722. X
  723. X#################################################################
  724. X# Object file generation:                    #
  725. X#################################################################
  726. X
  727. X$(WRKDIR)\attrib.obj:    attrib.c $(HEADERS)
  728. X    cd $(WRKDIR)
  729. X    command -c break on
  730. X    $(CC) $(CFLAGS) /output=attrib.asm ..\attrib.c
  731. X    command -c break on
  732. X    $(ASM) attrib.asm,attrib.obj,nul $(AFLAGS)
  733. X    cd ..
  734. X
  735. X$(WRKDIR)\beep.obj:    beep.c $(HEADERS)
  736. X    cd $(WRKDIR)
  737. X    command -c break on
  738. X    $(CC) $(CFLAGS) /output=beep.asm ..\beep.c
  739. X    command -c break on
  740. X    $(ASM) beep.asm,beep.obj,nul $(AFLAGS)
  741. X    cd ..
  742. X
  743. X$(WRKDIR)\border.obj:    border.c $(HEADERS)
  744. X    cd $(WRKDIR)
  745. X    command -c break on
  746. X    $(CC) $(CFLAGS) /output=border.asm ..\border.c
  747. X    command -c break on
  748. X    $(ASM) border.asm,border.obj,nul $(AFLAGS)
  749. X    cd ..
  750. X
  751. X$(WRKDIR)\boxes.obj:    boxes.c $(HEADERS)
  752. X    cd $(WRKDIR)
  753. X    command -c break on
  754. X    $(CC) $(CFLAGS) /output=boxes.asm ..\boxes.c
  755. X    command -c break on
  756. X    $(ASM) boxes.asm,boxes.obj,nul $(AFLAGS)
  757. X    cd ..
  758. X
  759. X$(WRKDIR)\charadd.obj:    charadd.c $(HEADERS)
  760. X    cd $(WRKDIR)
  761. X    command -c break on
  762. X    $(CC) $(CFLAGS) /output=charadd.asm ..\charadd.c
  763. X    command -c break on
  764. X    $(ASM) charadd.asm,charadd.obj,nul $(AFLAGS)
  765. X    cd ..
  766. X
  767. X$(WRKDIR)\chardel.obj:    chardel.c $(HEADERS)
  768. X    cd $(WRKDIR)
  769. X    $(CC) $(CFLAGS) /output=chardel.asm ..\chardel.c
  770. X    command -c break on
  771. X    $(ASM) chardel.asm,chardel.obj,nul $(AFLAGS)
  772. X    command -c break on
  773. X    cd ..
  774. X
  775. X$(WRKDIR)\charget.obj:    charget.c $(HEADERS)
  776. X    cd $(WRKDIR)
  777. X    command -c break on
  778. X    $(CC) $(CFLAGS) /output=charget.asm ..\charget.c
  779. X    command -c break on
  780. X    $(ASM) charget.asm,charget.obj,nul $(AFLAGS)
  781. X    cd ..
  782. X
  783. X$(WRKDIR)\charins.obj:    charins.c $(HEADERS)
  784. X    cd $(WRKDIR)
  785. X    command -c break on
  786. X    $(CC) $(CFLAGS) /output=charins.asm ..\charins.c
  787. X    command -c break on
  788. X    $(ASM) charins.asm,charins.obj,nul $(AFLAGS)
  789. X    cd ..
  790. X
  791. X$(WRKDIR)\charpick.obj:    charpick.c $(HEADERS)
  792. X    cd $(WRKDIR)
  793. X    command -c break on
  794. X    $(CC) $(CFLAGS) /output=charpick.asm ..\charpick.c
  795. X    command -c break on
  796. X    $(ASM) charpick.asm,charpick.obj,nul $(AFLAGS)
  797. X    cd ..
  798. X
  799. X$(WRKDIR)\clrtobot.obj:    clrtobot.c $(HEADERS)
  800. X    cd $(WRKDIR)
  801. X    command -c break on
  802. X    $(CC) $(CFLAGS) /output=clrtobot.asm ..\clrtobot.c
  803. X    command -c break on
  804. X    $(ASM) clrtobot.asm,clrtobot.obj,nul $(AFLAGS)
  805. X    cd ..
  806. X
  807. X$(WRKDIR)\clrtoeol.obj:    clrtoeol.c $(HEADERS)
  808. X    cd $(WRKDIR)
  809. X    command -c break on
  810. X    $(CC) $(CFLAGS) /output=clrtoeol.asm ..\clrtoeol.c
  811. X    command -c break on
  812. X    $(ASM) clrtoeol.asm,clrtoeol.obj,nul $(AFLAGS)
  813. X    cd ..
  814. X
  815. X$(WRKDIR)\endwin.obj:    endwin.c $(HEADERS)
  816. X    cd $(WRKDIR)
  817. X    command -c break on
  818. X    $(CC) $(CFLAGS) /output=endwin.asm ..\endwin.c
  819. X    command -c break on
  820. X    $(ASM) endwin.asm,endwin.obj,nul $(AFLAGS)
  821. X    cd ..
  822. X
  823. X$(WRKDIR)\initscr.obj:    initscr.c $(HEADERS)
  824. X    cd $(WRKDIR)
  825. X    command -c break on
  826. X    $(CC) $(CFLAGS) /output=initscr.asm ..\initscr.c
  827. X    command -c break on
  828. X    $(ASM) initscr.asm,initscr.obj,nul $(AFLAGS)
  829. X    cd ..
  830. X
  831. X$(WRKDIR)\linedel.obj:    linedel.c $(HEADERS)
  832. X    cd $(WRKDIR)
  833. X    command -c break on
  834. X    $(CC) $(CFLAGS) /output=linedel.asm ..\linedel.c
  835. X    command -c break on
  836. X    $(ASM) linedel.asm,linedel.obj,nul $(AFLAGS)
  837. X    cd ..
  838. X
  839. X$(WRKDIR)\lineins.obj:    lineins.c $(HEADERS)
  840. X    cd $(WRKDIR)
  841. X    command -c break on
  842. X    $(CC) $(CFLAGS) /output=lineins.asm ..\lineins.c
  843. X    command -c break on
  844. X    $(ASM) lineins.asm,lineins.obj,nul $(AFLAGS)
  845. X    cd ..
  846. X
  847. X$(WRKDIR)\longname.obj:    longname.c $(HEADERS)
  848. X    cd $(WRKDIR)
  849. X    command -c break on
  850. X    $(CC) $(CFLAGS) /output=longname.asm ..\longname.c
  851. X    command -c break on
  852. X    $(ASM) longname.asm,longname.obj,nul $(AFLAGS)
  853. X    cd ..
  854. X
  855. X$(WRKDIR)\move.obj:    move.c $(HEADERS)
  856. X    cd $(WRKDIR)
  857. X    command -c break on
  858. X    $(CC) $(CFLAGS) /output=move.asm ..\move.c
  859. X    command -c break on
  860. X    $(ASM) move.asm,move.obj,nul $(AFLAGS)
  861. X    cd ..
  862. X
  863. X$(WRKDIR)\mvcursor.obj:    mvcursor.c $(HEADERS)
  864. X    cd $(WRKDIR)
  865. X    command -c break on
  866. X    $(CC) $(CFLAGS) /output=mvcursor.asm ..\mvcursor.c
  867. X    command -c break on
  868. X    $(ASM) mvcursor.asm,mvcursor.obj,nul $(AFLAGS)
  869. X    cd ..
  870. X
  871. X$(WRKDIR)\newwin.obj:    newwin.c $(HEADERS)
  872. X    cd $(WRKDIR)
  873. X    command -c break on
  874. X    $(CC) $(CFLAGS) /output=newwin.asm ..\newwin.c
  875. X    command -c break on
  876. X    $(ASM) newwin.asm,newwin.obj,nul $(AFLAGS)
  877. X    cd ..
  878. X
  879. X$(WRKDIR)\options.obj:    options.c $(HEADERS)
  880. X    cd $(WRKDIR)
  881. X    command -c break on
  882. X    $(CC) $(CFLAGS) /output=options.asm ..\options.c
  883. X    command -c break on
  884. X    $(ASM) options.asm,options.obj,nul $(AFLAGS)
  885. X    cd ..
  886. X
  887. X$(WRKDIR)\overlay.obj:    overlay.c $(HEADERS)
  888. X    cd $(WRKDIR)
  889. X    command -c break on
  890. X    $(CC) $(CFLAGS) /output=overlay.asm ..\overlay.c
  891. X    command -c break on
  892. X    $(ASM) overlay.asm,overlay.obj,nul $(AFLAGS)
  893. X    cd ..
  894. X
  895. X$(WRKDIR)\prntscan.obj:    prntscan.c $(HEADERS)
  896. X    cd $(WRKDIR)
  897. X    command -c break on
  898. X    $(CC) $(CFLAGS) /output=prntscan.asm ..\prntscan.c
  899. X    command -c break on
  900. X    $(ASM) prntscan.asm,prntscan.obj,nul $(AFLAGS)
  901. X    cd ..
  902. X
  903. X$(WRKDIR)\refresh.obj:    refresh.c $(HEADERS)
  904. X    cd $(WRKDIR)
  905. X    command -c break on
  906. X    $(CC) $(CFLAGS) /output=refresh.asm ..\refresh.c
  907. X    command -c break on
  908. X    $(ASM) refresh.asm,refresh.obj,nul $(AFLAGS)
  909. X    cd ..
  910. X
  911. X$(WRKDIR)\scrreg.obj:    scrreg.c $(HEADERS)
  912. X    cd $(WRKDIR)
  913. X    command -c break on
  914. X    $(CC) $(CFLAGS) /output=scrreg.asm ..\scrreg.c
  915. X    command -c break on
  916. X    $(ASM) scrreg.asm,scrreg.obj,nul $(AFLAGS)
  917. X    cd ..
  918. X
  919. X$(WRKDIR)\setmode.obj:    setmode.c $(HEADERS)
  920. X    cd $(WRKDIR)
  921. X    command -c break on
  922. X    $(CC) $(CFLAGS) /output=setmode.asm ..\setmode.c
  923. X    command -c break on
  924. X    $(ASM) setmode.asm,setmode.obj,nul $(AFLAGS)
  925. X    cd ..
  926. X
  927. X$(WRKDIR)\setterm.obj:    setterm.c $(HEADERS)
  928. X    cd $(WRKDIR)
  929. X    command -c break on
  930. X    $(CC) $(CFLAGS) /output=setterm.asm ..\setterm.c
  931. X    command -c break on
  932. X    $(ASM) setterm.asm,setterm.obj,nul $(AFLAGS)
  933. X    cd ..
  934. X
  935. X$(WRKDIR)\stradd.obj:    stradd.c $(HEADERS)
  936. X    cd $(WRKDIR)
  937. X    command -c break on
  938. X    $(CC) $(CFLAGS) /output=stradd.asm ..\stradd.c
  939. X    command -c break on
  940. X    $(ASM) stradd.asm,stradd.obj,nul $(AFLAGS)
  941. X    cd ..
  942. X
  943. X$(WRKDIR)\strget.obj:    strget.c $(HEADERS)
  944. X    cd $(WRKDIR)
  945. X    command -c break on
  946. X    $(CC) $(CFLAGS) /output=strget.asm ..\strget.c
  947. X    command -c break on
  948. X    $(ASM) strget.asm,strget.obj,nul $(AFLAGS)
  949. X    cd ..
  950. X
  951. X$(WRKDIR)\tabsize.obj:    tabsize.c $(HEADERS)
  952. X    cd $(WRKDIR)
  953. X    command -c break on
  954. X    $(CC) $(CFLAGS) /output=tabsize.asm ..\tabsize.c
  955. X    command -c break on
  956. X    $(ASM) tabsize.asm,tabsize.obj,nul $(AFLAGS)
  957. X    cd ..
  958. X
  959. X$(WRKDIR)\termmisc.obj:    termmisc.c $(HEADERS)
  960. X    cd $(WRKDIR)
  961. X    command -c break on
  962. X    $(CC) $(CFLAGS) /output=termmisc.asm ..\termmisc.c
  963. X    command -c break on
  964. X    $(ASM) termmisc.asm,termmisc.obj,nul $(AFLAGS)
  965. X    cd ..
  966. X
  967. X$(WRKDIR)\unctrl.obj:    unctrl.c $(HEADERS)
  968. X    cd $(WRKDIR)
  969. X    command -c break on
  970. X    $(CC) $(CFLAGS) /output=unctrl.asm ..\unctrl.c
  971. X    command -c break on
  972. X    $(ASM) unctrl.asm,unctrl.obj,nul $(AFLAGS)
  973. X    cd ..
  974. X
  975. X$(WRKDIR)\update.obj:    update.c $(HEADERS)
  976. X    cd $(WRKDIR)
  977. X    command -c break on
  978. X    $(CC) $(CFLAGS) /output=update.asm ..\update.c
  979. X    command -c break on
  980. X    $(ASM) update.asm,update.obj,nul $(AFLAGS)
  981. X    cd ..
  982. X
  983. X$(WRKDIR)\winclear.obj:    winclear.c $(HEADERS)
  984. X    cd $(WRKDIR)
  985. X    command -c break on
  986. X    $(CC) $(CFLAGS) /output=winclear.asm ..\winclear.c
  987. X    command -c break on
  988. X    $(ASM) winclear.asm,winclear.obj,nul $(AFLAGS)
  989. X    cd ..
  990. X
  991. X$(WRKDIR)\windel.obj:    windel.c $(HEADERS)
  992. X    cd $(WRKDIR)
  993. X    command -c break on
  994. X    $(CC) $(CFLAGS) /output=windel.asm ..\windel.c
  995. X    command -c break on
  996. X    $(ASM) windel.asm,windel.obj,nul $(AFLAGS)
  997. X    cd ..
  998. X
  999. X$(WRKDIR)\winerase.obj:    winerase.c $(HEADERS)
  1000. X    cd $(WRKDIR)
  1001. X    command -c break on
  1002. X    $(CC) $(CFLAGS) /output=winerase.asm ..\winerase.c
  1003. X    command -c break on
  1004. X    $(ASM) winerase.asm,winerase.obj,nul $(AFLAGS)
  1005. X    cd ..
  1006. X
  1007. X$(WRKDIR)\winmove.obj:    winmove.c $(HEADERS)
  1008. X    cd $(WRKDIR)
  1009. X    command -c break on
  1010. X    $(CC) $(CFLAGS) /output=winmove.asm ..\winmove.c
  1011. X    command -c break on
  1012. X    $(ASM) winmove.asm,winmove.obj,nul $(AFLAGS)
  1013. X    cd ..
  1014. X
  1015. X$(WRKDIR)\winscrol.obj:    winscrol.c $(HEADERS)
  1016. X    cd $(WRKDIR)
  1017. X    command -c break on
  1018. X    $(CC) $(CFLAGS) /output=winscrol.asm ..\winscrol.c
  1019. X    command -c break on
  1020. X    $(ASM) winscrol.asm,winscrol.obj,nul $(AFLAGS)
  1021. X    cd ..
  1022. X
  1023. X$(WRKDIR)\wintouch.obj:    wintouch.c $(HEADERS)
  1024. X    cd $(WRKDIR)
  1025. X    command -c break on
  1026. X    $(CC) $(CFLAGS) /output=wintouch.asm ..\wintouch.c
  1027. X    command -c break on
  1028. X    $(ASM) wintouch.asm,wintouch.obj,nul $(AFLAGS)
  1029. X    cd ..
  1030. X
  1031. X$(WRKDIR)\curses68.obj:    curses68.c $(HEADERS)
  1032. X    cd $(WRKDIR)
  1033. X    command -c break on
  1034. X    $(CC) $(CFLAGS) /output=curses68.asm ..\curses68.c
  1035. X    command -c break on
  1036. X    $(ASM) curses68.asm,curses68.obj,nul $(AFLAGS)
  1037. X    cd ..
  1038. X
  1039. X#################################################################
  1040. X# Maintenance chores                        #
  1041. X#################################################################
  1042. X
  1043. Xclean:
  1044. X    rm -il $(WRKDIR)\*.*
  1045. X    rmdir  $(WRKDIR)
  1046. X
  1047. Xshar:
  1048. X    command -c makekit -x *.* >manifest
  1049. X    makekit -m *.*
  1050. X    del manifest.*
  1051. END_OF_makefile.68
  1052. if test 11256 -ne `wc -c <makefile.68`; then
  1053.     echo \"makefile.68\" unpacked with wrong size!
  1054. fi
  1055. # end of overwriting check
  1056. fi
  1057. if test -f prntscan.c -a "${1}" != "-c" ; then 
  1058.   echo Will not over-write existing file \"prntscan.c\"
  1059. else
  1060. echo Extracting - \"prntscan.c\"
  1061. sed "s/^X//" >prntscan.c <<'END_OF_prntscan.c'
  1062. X/****************************************************************/
  1063. X/* Printw() and scanw() routines of the PCcurses package    */
  1064. X/*                                */
  1065. X/****************************************************************/
  1066. X/* This version of curses is based on ncurses, a curses version    */
  1067. X/* originally written by Pavel Curtis at Cornell University.    */
  1068. X/* I have made substantial changes to make it run on IBM PC's,    */
  1069. X/* and therefore consider myself free to make it public domain.    */
  1070. X/*                Bjorn Larsson (bl@infovox.se)    */
  1071. X/****************************************************************/
  1072. X/*             IMPLEMENTATION NOTE 1            */
  1073. X/* These routines make a local copy of their parameter stack,    */
  1074. X/* assuming at most 5 'double' arguments were passed (== 40    */
  1075. X/* bytes == 20 int's == 10 long's == 10-20 pointers {depending    */
  1076. X/* on memory model}, etc). This means the invokation of the    */
  1077. X/* routines themself require at least 80 bytes of stack just    */
  1078. X/* for the parameters, and the sprintf() and sscanf() functions    */
  1079. X/* will require more. Therefore, this module should be compiled    */
  1080. X/* with stack checking on to avoid stack overflow errors.    */
  1081. X/****************************************************************/
  1082. X/*             IMPLEMENTATION NOTE 2            */
  1083. X/* This curses version is also used in a special environment    */
  1084. X/* with a 68000 CPU. The 68K compiler used has a bug in the    */
  1085. X/* standard library, which means that sprintf will not print    */
  1086. X/* newlines right. Therefore a workaround has been included in    */
  1087. X/* this file, conditionalized by '#if BUG68K'. This does not    */
  1088. X/* affect the PC version in any way, except the source is a    */
  1089. X/* little more obscure...                    */
  1090. X/****************************************************************/
  1091. X/* 1.4:  Use of short wherever possible. Portability        */
  1092. X/*     improvements. 68K bug workaround:        900114    */
  1093. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1094. X/* 1.2:     Rcsid[] string for maintenance:        881002    */
  1095. X/* 1.0:     Release:                    870515    */
  1096. X/****************************************************************/
  1097. X
  1098. X#include <curses.h>
  1099. X#include <curspriv.h>
  1100. X
  1101. Xchar _curses_prntscan_rcsid[] = "@(#)prntscan.c   v.1.4  - 900114";
  1102. X
  1103. Xstatic    int    pblen();        /* gets length of buffer */
  1104. X
  1105. X#if BUG68K
  1106. Xstatic    void    setnl();        /* conv nl -> CTRL-\ */
  1107. Xstatic    void    getnl();        /* conv CTRL-\ -> nl */
  1108. X#endif
  1109. X
  1110. Xstatic    char    printscanbuf[513];    /* buffer used during I/O */
  1111. X
  1112. X/****************************************************************/
  1113. X/* Wprintw(win,fmt,args) does a printf() in window 'win'.    */
  1114. X/****************************************************************/
  1115. X
  1116. Xint    wprintw(win,fmt,A1,A2,A3,A4,A5)
  1117. X  WINDOW    *win;
  1118. X  char        *fmt;
  1119. X  double     A1,A2,A3,A4,A5;
  1120. X  {
  1121. X#if BUG68K
  1122. X  setnl(fmt);
  1123. X  sprintf(printscanbuf,fmt,A1,A2,A3,A4,A5);
  1124. X  getnl(fmt);
  1125. X  getnl(printscanbuf);
  1126. X#else
  1127. X  sprintf(printscanbuf,fmt,A1,A2,A3,A4,A5);
  1128. X#endif
  1129. X  if (waddstr(win,printscanbuf) == ERR)
  1130. X    return(ERR);
  1131. X  return(pblen());
  1132. X  } /* wprintw */
  1133. X
  1134. X/****************************************************************/
  1135. X/* Printw(fmt,args) does a printf() in stdscr.            */
  1136. X/****************************************************************/
  1137. X
  1138. Xint    printw(fmt,A1,A2,A3,A4,A5)
  1139. X  char        *fmt;
  1140. X  double     A1,A2,A3,A4,A5;
  1141. X  {
  1142. X#if BUG68K
  1143. X  setnl(fmt);
  1144. X  sprintf(printscanbuf,fmt,A1,A2,A3,A4,A5);
  1145. X  getnl(fmt);
  1146. X  getnl(printscanbuf);
  1147. X#else
  1148. X  sprintf(printscanbuf,fmt,A1,A2,A3,A4,A5);
  1149. X#endif
  1150. X  if(waddstr(stdscr,printscanbuf) == ERR)
  1151. X    return(ERR);
  1152. X  return(pblen());
  1153. X  } /* printw */
  1154. X
  1155. X/****************************************************************/
  1156. X/* Mvprintw(fmt,args) moves the stdscr cursor to a new posi-    */
  1157. X/* tion, then does a printf() in stdscr.            */
  1158. X/****************************************************************/
  1159. X
  1160. Xint    mvprintw(y,x,fmt,A1,A2,A3,A4,A5)
  1161. X  int         y;
  1162. X  int         x;
  1163. X  char        *fmt;
  1164. X  double     A1,A2,A3,A4,A5;
  1165. X  {
  1166. X  if (wmove(stdscr,y,x) == ERR)
  1167. X    return(ERR);
  1168. X#if BUG68K
  1169. X  setnl(fmt);
  1170. X  sprintf(printscanbuf,fmt,A1,A2,A3,A4,A5);
  1171. X  getnl(fmt);
  1172. X  getnl(printscanbuf);
  1173. X#else
  1174. X  sprintf(printscanbuf,fmt,A1,A2,A3,A4,A5);
  1175. X#endif
  1176. X  if(waddstr(stdscr,printscanbuf) == ERR)
  1177. X    return(ERR);
  1178. X  return(pblen());
  1179. X  } /* mvprintw */
  1180. X
  1181. X/****************************************************************/
  1182. X/* Mvwprintw(win,fmt,args) moves the window 'win's cursor to    */
  1183. X/* a new position, then does a printf() in window 'win'.    */
  1184. X/****************************************************************/
  1185. X
  1186. Xint    mvwprintw(win,y,x,fmt,A1,A2,A3,A4,A5)
  1187. X  WINDOW    *win;
  1188. X  int         y;
  1189. X  int         x;
  1190. X  char        *fmt;
  1191. X  double     A1,A2,A3,A4,A5;
  1192. X  {
  1193. X  if (wmove(win,y,x) == ERR)
  1194. X    return(ERR);
  1195. X#if BUG68K
  1196. X  setnl(fmt);
  1197. X  sprintf(printscanbuf,fmt,A1,A2,A3,A4,A5);
  1198. X  getnl(fmt);
  1199. X  getnl(printscanbuf);
  1200. X#else
  1201. X  sprintf(printscanbuf,fmt,A1,A2,A3,A4,A5);
  1202. X#endif
  1203. X  if(waddstr(win,printscanbuf) == ERR)
  1204. X    return(ERR);
  1205. X  return(pblen());
  1206. X  } /* mvwprintw */
  1207. X
  1208. X/****************************************************************/
  1209. X/* Wscanw(win,fmt,args) gets a string via window 'win', then    */
  1210. X/* scans the string using format 'fmt' to extract the values    */
  1211. X/* and put them in the variables pointed to the arguments.    */
  1212. X/****************************************************************/
  1213. X
  1214. Xint wscanw(win,fmt,A1,A2,A3,A4,A5)
  1215. X  WINDOW    *win;
  1216. X  char        *fmt;
  1217. X  double     A1,A2,A3,A4,A5;        /* really pointers */
  1218. X  {
  1219. X  wrefresh(win);                /* set cursor */
  1220. X  if (wgetstr(win,printscanbuf) == ERR)        /* get string */
  1221. X    return(ERR);
  1222. X  return(sscanf(printscanbuf,fmt,A1,A2,A3,A4,A5));
  1223. X  } /* wscanw */
  1224. X
  1225. X/****************************************************************/
  1226. X/* Scanw(fmt,args) gets a string via stdscr, then scans the    */
  1227. X/* string using format 'fmt' to extract the values and put them    */
  1228. X/* in the variables pointed to the arguments.            */
  1229. X/****************************************************************/
  1230. X
  1231. Xint scanw(fmt,A1,A2,A3,A4,A5)
  1232. X  char        *fmt;
  1233. X  double     A1,A2,A3,A4,A5;        /* really pointers */
  1234. X  {
  1235. X  wrefresh(stdscr);                /* set cursor */
  1236. X  if (wgetstr(stdscr,printscanbuf) == ERR)    /* get string */
  1237. X    return(ERR);
  1238. X  return(sscanf(printscanbuf,fmt,A1,A2,A3,A4,A5));
  1239. X  } /* scanw */
  1240. X
  1241. X/****************************************************************/
  1242. X/* Mvscanw(y,x,fmt,args) moves stdscr's cursor to a new posi-    */
  1243. X/* tion, then gets a string via stdscr and scans the string    */
  1244. X/* using format 'fmt' to extract the values and put them in the    */
  1245. X/* variables pointed to the arguments.                */
  1246. X/****************************************************************/
  1247. X
  1248. Xint mvscanw(y,x,fmt,A1,A2,A3,A4,A5)
  1249. X  int         y;
  1250. X  int         x;
  1251. X  char        *fmt;
  1252. X  double     A1,A2,A3,A4,A5;        /* really pointers */
  1253. X  {
  1254. X  if (wmove(stdscr,y,x) == ERR)
  1255. X    return(ERR);
  1256. X  wrefresh(stdscr);                /* set cursor */
  1257. X  if (wgetstr(stdscr,printscanbuf) == ERR)    /* get string */
  1258. X    return(ERR);
  1259. X  return(sscanf(printscanbuf,fmt,A1,A2,A3,A4,A5));
  1260. X  } /* mvscanw */
  1261. X
  1262. X/****************************************************************/
  1263. X/* Mvwscanw(win,y,x,fmt,args) moves window 'win's cursor to a    */
  1264. X/* new position, then gets a string via 'win' and scans the    */
  1265. X/* string using format 'fmt' to extract the values and put them    */
  1266. X/* in the variables pointed to the arguments.            */
  1267. X/****************************************************************/
  1268. X
  1269. Xint mvwscanw(win,y,x,fmt,A1,A2,A3,A4,A5)
  1270. X  WINDOW    *win;
  1271. X  int         y;
  1272. X  int         x;
  1273. X  char        *fmt;
  1274. X  double     A1,A2,A3,A4,A5;        /* really pointers */
  1275. X  {
  1276. X  if (wmove(win,y,x) == ERR)
  1277. X    return(ERR);
  1278. X  wrefresh(win);                /* set cursor */
  1279. X  if (wgetstr(win,printscanbuf) == ERR)        /* get string */
  1280. X    return(ERR);
  1281. X  return(sscanf(printscanbuf,fmt,A1,A2,A3,A4,A5));
  1282. X  } /* mvwscanw */
  1283. X
  1284. X/****************************************************************/
  1285. X/* Pblen() returns the length of the string in printscanbuf.    */
  1286. X/****************************************************************/
  1287. X
  1288. Xstatic    int pblen()
  1289. X  {
  1290. X  char *p = printscanbuf;
  1291. X  
  1292. X  while(*p++);
  1293. X  return((int) (p - printscanbuf - 1));
  1294. X  } /* plben */
  1295. X
  1296. X#if BUG68K
  1297. X/****************************************************************/   
  1298. X/* This function circumvents a problem in the 68000 C library:    */
  1299. X/* If the standard sprintf is used, it will ignore any newlines    */
  1300. X/* in the format string. Therefore this routine changes the    */
  1301. X/* newlines to CTRL-\ characters, to be restored later by the    */
  1302. X/* getnl() function.                        */
  1303. X/****************************************************************/
  1304. X
  1305. Xstatic    void setnl(fmt)
  1306. X  char    *fmt;
  1307. X  {
  1308. X  while (*fmt)
  1309. X    {
  1310. X    if (*fmt == '\n')
  1311. X      *fmt = 0x1c;
  1312. X    fmt++;
  1313. X    } /* while */
  1314. X  } /* setnl */
  1315. X
  1316. X/****************************************************************/
  1317. X/* This function circumvents a problem in the 68000 C library:    */
  1318. X/* If the standard sprintf is used, it will ignore any newlines    */
  1319. X/* in the format string. Therefore this routine changes CTRL-\    */
  1320. X/* characters (already set by setnl()) back to newlines.    */
  1321. X/****************************************************************/
  1322. X
  1323. Xstatic    void getnl(fmt)
  1324. X  char    *fmt;
  1325. X  {
  1326. X  while (*fmt)
  1327. X    {
  1328. X    if (*fmt == 0x1c)
  1329. X      *fmt = '\n';
  1330. X    fmt++;
  1331. X    } /* while */
  1332. X  } /* getnl */
  1333. X#endif
  1334. END_OF_prntscan.c
  1335. if test 8950 -ne `wc -c <prntscan.c`; then
  1336.     echo \"prntscan.c\" unpacked with wrong size!
  1337. fi
  1338. # end of overwriting check
  1339. fi
  1340. if test -f update.c -a "${1}" != "-c" ; then 
  1341.   echo Will not over-write existing file \"update.c\"
  1342. else
  1343. echo Extracting - \"update.c\"
  1344. sed "s/^X//" >update.c <<'END_OF_update.c'
  1345. X/****************************************************************/
  1346. X/* Doupdate() routine of the PCcurses package            */
  1347. X/*                                */
  1348. X/****************************************************************/
  1349. X/* This version of curses is based on ncurses, a curses version    */
  1350. X/* originally written by Pavel Curtis at Cornell University.    */
  1351. X/* I have made substantial changes to make it run on IBM PC's,    */
  1352. X/* and therefore consider myself free to make it public domain.    */
  1353. X/*                Bjorn Larsson (bl@infovox.se)    */
  1354. X/****************************************************************/
  1355. X/* 1.4:  Use of short wherever possible. Portability        */
  1356. X/*     improvements. Superflous parameter in            */
  1357. X/*     cursescattr() removed. Clearscreen() changed        */
  1358. X/*     so curses is guaranteed to know where the psy-        */
  1359. X/*     sical cursor is at all times:            900114    */
  1360. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1361. X/* 1.2:     Changed call sequence to cursesio.[c,asm], Thanks    */
  1362. X/*     to S. Creps. Rcsid[] string for maintenance:    881002    */
  1363. X/* 1.0:     Release:                    870515    */
  1364. X/****************************************************************/
  1365. X
  1366. X#include <curses.h>
  1367. X#include <curspriv.h>
  1368. X
  1369. Xstatic void clrupdate();        /* fwd declaration */
  1370. Xstatic bool transformline();
  1371. Xstatic void clearscreen();
  1372. Xstatic void gotoxy();
  1373. Xstatic void Putchar();
  1374. X
  1375. Xchar _curses_update_rcsid[] = "@(#)update.c     v.1.4  - 900114";
  1376. X
  1377. Xstatic WINDOW    *twin;            /* used by many routines */
  1378. X
  1379. Xstatic    char     atrtab[64] =        /* attribute encoding table. */
  1380. X  {                    /* feel free to edit if your */
  1381. X  (char)7,    /* NORMAL (0) */    /* display board supports all */
  1382. X  (char)0x87,    /* BLINK */        /* possible combinations */
  1383. X  (char)0,    /* BLANK */
  1384. X  (char)0,    /* BLINK & BLANK */
  1385. X  (char)0xf,    /* BOLD */
  1386. X  (char)0x8f,    /* BOLD & BLINK */
  1387. X  (char)0,    /* BOLD & BLANK */
  1388. X  (char)0,    /* BOLD & BLINK & BLANK */
  1389. X  (char)0x70,    /* REVERSE (8) */
  1390. X  (char)0xf0,    /* REVERSE & BLINK */
  1391. X  (char)0,    /* REVERSE & BLANK */
  1392. X  (char)0,    /* REVERSE & BLINK & BLANK */
  1393. X  (char)0x78,    /* REVERSE & BOLD */
  1394. X  (char)0xf8,    /* REVERSE & BOLD & BLINK */
  1395. X  (char)0,    /* REVERSE & BOLD & BLANK */
  1396. X  (char)0,    /* REVERSE & BOLD & BLINK & BLANK */
  1397. X  (char)0xf,    /* STANDOUT (10) */
  1398. X  (char)0x8f,    /* STANDOUT & BLINK */
  1399. X  (char)0,    /* STANDOUT & BLANK */
  1400. X  (char)0,    /* STANDOUT & BLINK & BLANK */
  1401. X  (char)0xf,    /* STANDOUT & BOLD */
  1402. X  (char)0x8f,    /* STANDOUT & BOLD & BLINK */
  1403. X  (char)0,    /* STANDOUT & BOLD & BLANK */
  1404. X  (char)0,    /* STANDOUT & BOLD & BLINK & BLANK */
  1405. X  (char)0x70,    /* STANDOUT & REVERSE (18) */
  1406. X  (char)0xf0,    /* STANDOUT & REVERSE & BLINK */
  1407. X  (char)0,    /* STANDOUT & REVERSE & BLANK */
  1408. X  (char)0,    /* STANDOUT & REVERSE & BLINK & BLANK */
  1409. X  (char)0x70,    /* STANDOUT & REVERSE & BOLD */
  1410. X  (char)0xf0,    /* STANDOUT & REVERSE & BOLD & BLINK */
  1411. X  (char)0,    /* STANDOUT & REVERSE & BOLD & BLANK */
  1412. X  (char)0,    /* STANDOUT & REVERSE & BOLD & BLINK & BLANK */
  1413. X  (char)1,    /* UNDERLINE (20) */
  1414. X  (char)0x81,    /* UNDERLINE & BLINK */
  1415. X  (char)0,    /* UNDERLINE & BLANK */
  1416. X  (char)0,    /* UNDERLINE & BLINK & BLANK */
  1417. X  (char)9,    /* UNDERLINE & BOLD */
  1418. X  (char)0x89,    /* UNDERLINE & BOLD & BLINK */
  1419. X  (char)0,    /* UNDERLINE & BOLD & BLANK */
  1420. X  (char)0,    /* UNDERLINE & BOLD & BLINK & BLANK */
  1421. X  (char)0x70,    /* UNDERLINE & REVERSE (28) */
  1422. X  (char)0xf0,    /* UNDERLINE & REVERSE & BLINK */
  1423. X  (char)0,    /* UNDERLINE & REVERSE & BLANK */
  1424. X  (char)0,    /* UNDERLINE & REVERSE & BLINK & BLANK */
  1425. X  (char)0x79,    /* UNDERLINE & REVERSE & BOLD */
  1426. X  (char)0xf9,    /* UNDERLINE & REVERSE & BOLD & BLINK */
  1427. X  (char)0,    /* UNDERLINE & REVERSE & BOLD & BLANK */
  1428. X  (char)0,    /* UNDERLINE & REVERSE & BOLD & BLINK & BLANK */
  1429. X  (char)9,    /* UNDERLINE & STANDOUT (30) */
  1430. X  (char)0x89,    /* UNDERLINE & STANDOUT & BLINK */
  1431. X  (char)0,    /* UNDERLINE & STANDOUT & BLANK */
  1432. X  (char)0,    /* UNDERLINE & STANDOUT & BLINK & BLANK */
  1433. X  (char)9,    /* UNDERLINE & STANDOUT & BOLD */
  1434. X  (char)0x89,    /* UNDERLINE & STANDOUT & BOLD & BLINK */
  1435. X  (char)0,    /* UNDERLINE & STANDOUT & BOLD & BLANK */
  1436. X  (char)0,    /* UNDERLINE & STANDOUT & BOLD & BLINK & BLANK */
  1437. X  (char)0x70,    /* UNDERLINE & STANDOUT & REVERSE (38) */
  1438. X  (char)0xf0,    /* UNDERLINE & STANDOUT & REVERSE & BLINK */
  1439. X  (char)0,    /* UNDERLINE & STANDOUT & REVERSE & BLANK */
  1440. X  (char)0,    /* UNDERLINE & STANDOUT & REVERSE & BLINK & BLANK */
  1441. X  (char)0x70,    /* UNDERLINE & STANDOUT & REVERSE & BOLD */
  1442. X  (char)0xf0,    /* UNDERLINE & STANDOUT & REVERSE & BOLD & BLINK */
  1443. X  (char)0,    /* UNDERLINE & STANDOUT & REVERSE & BOLD & BLANK */
  1444. X  (char)0,    /* UNDERLINE & STANDOUT & REVERSE & BOLD & BLINK & BLANK */
  1445. X  };
  1446. X
  1447. X/****************************************************************/
  1448. X/* Doupdate() updates the physical screen to look like _curs-   */
  1449. X/* var.tmpwin if curscr is not 'Clear-marked'. Otherwise it    */
  1450. X/* updates the screen to look like curscr.            */
  1451. X/****************************************************************/
  1452. X
  1453. Xvoid doupdate()
  1454. X  {
  1455. X  short     i;
  1456. X
  1457. X  twin   = _cursvar.tmpwin;
  1458. X  if (curscr->_clear)
  1459. X    clrupdate(curscr);
  1460. X  else
  1461. X    {
  1462. X    if (twin->_clear)
  1463. X      clrupdate(twin);
  1464. X    else
  1465. X      {
  1466. X      for (i=0; i < LINES; i++)
  1467. X    if (twin->_minchng[i] != _NO_CHANGE)
  1468. X      if (transformline(i))
  1469. X        break;
  1470. X      } /* else */
  1471. X    } /* else */
  1472. X  curscr->_curx = twin->_curx;
  1473. X  curscr->_cury = twin->_cury;
  1474. X  gotoxy(curscr->_cury, curscr->_curx);
  1475. X  } /* doupdate */
  1476. X
  1477. X/****************************************************************/
  1478. X/* Clrupdate(scr) updates the screen by clearing it and then    */
  1479. X/* redraw it in it's entirety. If _cursvar.refrbrk is TRUE, and    */
  1480. X/* there is pending input characters, the update will be pre-    */
  1481. X/* maturely terminated.                        */
  1482. X/****************************************************************/
  1483. X
  1484. Xstatic void clrupdate(scr)
  1485. X  WINDOW    *scr;
  1486. X  {
  1487. X  short        *src;
  1488. X  short        *dst;
  1489. X  short         i;
  1490. X  short         j;
  1491. X  static WINDOW    *w;
  1492. X
  1493. X  w = curscr;
  1494. X
  1495. X  if (scr != w)                /* copy scr to curscr */
  1496. X    {
  1497. X    for (i=0; i < LINES; i++)
  1498. X      {
  1499. X      src = scr->_line[i];
  1500. X      dst = w->_line[i];
  1501. X      for (j=0; j < COLS; j++)
  1502. X    *dst++ = *src++;
  1503. X      } /* for */
  1504. X    } /* if */
  1505. X  clearscreen();            /* clear physical screen */
  1506. X  scr->_clear = FALSE;
  1507. X  for (i=0; i < LINES; i++)        /* update physical screen */
  1508. X    {
  1509. X    src = w->_line[i];
  1510. X    for(j=0; j < COLS; j++)
  1511. X      {
  1512. X      if (*src != (' ' | ATR_NRM))
  1513. X    {
  1514. X    gotoxy(i,j);
  1515. X    Putchar(*src);
  1516. X    } /* if */
  1517. X      src++;
  1518. X      } /* for */
  1519. X    if(_cursvar.refrbrk && _cursespendch())
  1520. X      return;
  1521. X    } /* for */
  1522. X  } /* clrupdate */
  1523. X
  1524. X/****************************************************************/
  1525. X/* Transformline() updates the given physical line to look    */
  1526. X/* like the corresponding line in _cursvar.tmpwin. Transform-    */
  1527. X/* line returns 1 if premature refresh end is allowed, and    */
  1528. X/* there is an input character pending.                */
  1529. X/****************************************************************/
  1530. X
  1531. Xstatic bool transformline(lineno)
  1532. X  register int    lineno;
  1533. X  {
  1534. X  short        *dstp;
  1535. X  short        *srcp;
  1536. X  short         x;
  1537. X  short         endx;
  1538. X
  1539. X  x    = twin->_minchng[lineno];
  1540. X  endx = twin->_maxchng[lineno];
  1541. X  dstp = curscr->_line[lineno] + x;
  1542. X  srcp = twin->_line[lineno] + x;
  1543. X  
  1544. X  for( ; x <= endx; x++)
  1545. X    {
  1546. X    if(*dstp != *srcp)
  1547. X      {
  1548. X      gotoxy(lineno,x);
  1549. X      Putchar(*srcp);
  1550. X      } /* if */
  1551. X    *dstp++ = *srcp++;
  1552. X    } /* for */
  1553. X  twin->_minchng[lineno] = _NO_CHANGE;
  1554. X  twin->_maxchng[lineno] = _NO_CHANGE;
  1555. X  return ((bool)(_cursvar.refrbrk && _cursespendch()));
  1556. X  } /* transformline */
  1557. X
  1558. X/****************************************************************/
  1559. X/* Clearscreen() clears the physical screen and puts the cursor    */
  1560. X/* in the home position.                    */
  1561. X/****************************************************************/
  1562. X
  1563. Xstatic void clearscreen()
  1564. X  {
  1565. X  _cursesscroll(0,0,LINES-1,COLS-1,0,atrtab[0]);
  1566. X  _cursescursor(0,0);
  1567. X  _cursvar.cursrow = 0;
  1568. X  _cursvar.curscol = 0;
  1569. X  } /* clearscreen */
  1570. X
  1571. X/****************************************************************/
  1572. X/* Gotoxy() moves the physical cursor to the desired address on    */
  1573. X/* the screen. We don't optimize here - on a PC, it takes more    */
  1574. X/* time to optimize than to do things directly.            */
  1575. X/****************************************************************/
  1576. X
  1577. Xstatic void gotoxy(row,col)
  1578. X  int row, col;
  1579. X  {
  1580. X  if((_cursvar.cursrow == row) && (_cursvar.curscol == col))
  1581. X    return;
  1582. X  _cursescursor(row,col);
  1583. X  _cursvar.cursrow = row;
  1584. X  _cursvar.curscol = col;
  1585. X  } /* gotoxy */
  1586. X
  1587. X/****************************************************************/
  1588. X/* Putchar() writes a character, with attributes, to the physi-    */
  1589. X/* cal screen, but avoids writing to the lower right screen    */
  1590. X/* position.                            */
  1591. X/****************************************************************/
  1592. X
  1593. Xstatic void Putchar(ch)
  1594. X  int ch;
  1595. X  {
  1596. X  if ((_cursvar.cursrow < LINES) || (_cursvar.curscol < COLS))
  1597. X    _cursescattr(ch,atrtab[(ch >> 8) & 0x3f]);
  1598. X  } /* Putchar */
  1599. END_OF_update.c
  1600. if test 8693 -ne `wc -c <update.c`; then
  1601.     echo \"update.c\" unpacked with wrong size!
  1602. fi
  1603. # end of overwriting check
  1604. fi
  1605. echo End of archive 4 \(of 7\).
  1606. cp /dev/null archdone.4
  1607. MISSING=""
  1608. for I in 1 2 3 4 5 6 7 ; do
  1609.     if test ! -f archdone.${I} ; then
  1610.     MISSING="${MISSING} ${I}"
  1611.     fi
  1612. done
  1613. if test "${MISSING}" = "" ; then
  1614.     echo You have unpacked all 7 archives.
  1615.     rm -f archdone.[1-9]
  1616. else
  1617.     echo You still need to unpack the following archives:
  1618.     echo "        " ${MISSING}
  1619. fi
  1620. ##  End of shell archive.
  1621. exit 0
  1622.  
  1623.